package com.health.dao;

import com.github.pagehelper.Page;
import com.health.pojo.Menu;
import org.apache.ibatis.annotations.Param;

import java.util.LinkedHashSet;
import java.util.List;

/**
 * @Classname SetmealDao
 * @Description TODO
 * @Version 1.0.0
 * @Date 2023/3/16 14:47
 * @Author RainGrd
 */
public interface MenuDao {


    List<Menu> selectMenuByLevelAndRoleId(@Param("roleId") Integer roleId, @Param("level") int level);

    List<Menu> selectMenuByParentMenuIdAndRoleId(@Param("id") Integer id,@Param("roleId") Integer roleId);

    LinkedHashSet<Menu> selectMenuByRoleId(Integer roleId);

    Menu selectMenuByMenuId(Integer id);

    int insertMenu(Menu menu);

    int insertMenuAndRole(@Param("menu_id") Integer menuId, @Param("role_id") Integer roleId);

    List<Menu> selectMenuListByLevel();

    Page<Menu> selectMenuByCondition(@Param("queryString") String queryString);


    long selectTotalByCondition(@Param("queryString") String queryString);

    List<Integer> selectRoleIdsByMenuId(@Param("menu_id") Integer menuId);

    void deleteAssociation(@Param("menu_id") Integer id);

    int updateMenu(Menu menu);

    int deleteMenu(Integer id);
}
